package site.liuming.truismcms.web.pojo;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

public class Log implements Serializable {
    private Long id;

    private String message;

    private Long userId;

    private String username;

    private String statusCode;

    private String method;

    private String path;

    private String permission;

    private Date publishTime;

    private Date updateTime;

    private Date deleteTime;

    private static final long serialVersionUID = 1L;

    public Log() {
    }

    public Log(String template, String permission, Long userId, String username, String method, String path, Integer status) {
        this.message = template;
        this.permission = permission;
        this.userId = userId;
        this.username = username;
        this.method = method;
        this.path = path;
        this.statusCode = String.valueOf(status);
        this.publishTime = Calendar.getInstance().getTime();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getPermission() {
        return permission;
    }

    public void setPermission(String permission) {
        this.permission = permission;
    }

    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getDeleteTime() {
        return deleteTime;
    }

    public void setDeleteTime(Date deleteTime) {
        this.deleteTime = deleteTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", message=").append(message);
        sb.append(", userId=").append(userId);
        sb.append(", username=").append(username);
        sb.append(", statusCode=").append(statusCode);
        sb.append(", method=").append(method);
        sb.append(", path=").append(path);
        sb.append(", permission=").append(permission);
        sb.append(", publishTime=").append(publishTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", deleteTime=").append(deleteTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}